//
//  optimization.h
//  template4
//
//  Created by Yuchen Liu on 6/5/12.
//  Copyright 2012 UCLA. All rights reserved.
//

#ifndef template4_optimization_h
#define template4_optimization_h



#endif

#include "common.h"
#include "engine.h"

struct ParamSet 
{
    int numController;
    int numTimepoints;
    double** u; // first order: timepoint, second order: controller param
};


class COptimization
{
private: 
    int numController;
    double duration;
    double timestep;
    int numTimepoints;
    
    double* ctrUpper;
    double* ctrLower;
    
public:
    COptimization();
    ParamSet initialize(int _numController, double _duration, double _timestep, double* _ctrUpper, double* _ctrLower, double* _initVal);
    ParamSet update(ParamSet curParam, double heat, double range);
    
    bird_dof* realize_bird_action(ParamSet param);
    double evaluate_objective_function(bird_dof* series);
    
    
};